package com.leon.classify.service;

import java.util.List;

import com.leon.classify.dao.ClassifyDao;
import com.leon.classify.domain.CommentDetail;
import com.leon.classify.domain.Company;
import com.leon.classify.domain.FirstClass;
import com.leon.classify.domain.SecondClass;

public class ClassifyService {
	
	private ClassifyDao classifyDao;
	
	/**
	 * 得到所有的一级分类
	 * @return
	 */
	public List<FirstClass> getFirstClassify(){
		List<FirstClass> list=null;
		list=classifyDao.getFirstClassify();
		return list;
	}
	/**
	 * 创建一个FirstClass
	 * @param fc
	 */
	public void createClassify(Object obj){
		classifyDao.createClassify(obj);
	}
	/**
	 * 删除一个一级分类
	 * @param classId
	 */
	public void deleteFirstClassify(String classId){
		classifyDao.deleteFirstClassify(classId);
	}
	
	/**
	 * 得到一个一级分类
	 * @param classId
	 * @return
	 */
	public FirstClass getFirstClass(String classId){
		return classifyDao.getFirstClass(classId);
	}
	
	/**
	 * 删除一个二级分类
	 * @param classId
	 */
	public void deleteSecondClassify(String classId){
		classifyDao.deleteSecondClassify(classId);
	}
	
	/**
	 * 得到一个二级分类
	 * @param classId
	 * @return
	 */
	public SecondClass getSecondClass(String classId){
		return classifyDao.getSecondClass(classId);
	}
	/**
	 * 创建一个公司
	 * @param obj
	 */
	public void createCompany(Object obj){
		classifyDao.createObject(obj);
	}
	public void updateFirstClassify(FirstClass fc){
		classifyDao.updateFirstClassify(fc);
	}
	public void updateSecondClassify(SecondClass sc){
		classifyDao.updateObject(sc);
	}
	public void deleteCompany(String companyId){
		classifyDao.deleteCompany(companyId);
	}
	/**
	 * 得到所有的二级分类
	 * @return
	 */
	public List<SecondClass> getSecondClassify(){
		List<SecondClass> list=null;
		list=classifyDao.getSecondClassify();
		return list;
	}
	public Company getCompany(String companyId){
		return classifyDao.getCompany(companyId);
	}
	public ClassifyDao getClassifyDao() {
		return classifyDao;
	}
	
	public void setClassifyDao(ClassifyDao classifyDao) {
		this.classifyDao = classifyDao;
	}
	public List<CommentDetail> getAllCommentDetail(String commentId,int start,int limit){
		return classifyDao.getAllCommentDetail(commentId, start, limit);
	}
	public List<Company> getSearchDetl(String searchValue){
		return classifyDao.getSearchDetl(searchValue);
	}
	
}
